package com.wn.work;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author yellow Docter
 * @date 2023 -02-28
 * @desc
 */
@Component
public class Work04Provider {

    /**
     * RabbitTemplate MQ 发送消息的模板 (Springboot 封装的MQ给我们使用)
     *                  redidTemplate
     *                  SMSTemplate
     */
    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void send(String exchangeName,String key,String msg){

        /**
         * 消息的发送:
         * 参数1:交换机
         * 参数2:路由
         * 参数3:消息
         */
        rabbitTemplate.convertAndSend(exchangeName,key,msg);

    }
}
